{extend name="default/shops/base" /}
{block name="title"}商品卡券-卖家中心{__block__}{/block}
{block name="content"}
<style>
.layui-layer-btn .layui-layer-btn0{background:#e45050;border-color:#e45050;}
.webuploader-container{width:80px;height:30px;overflow: hidden;float:right;margin:10px 5px 0px 5px;}
.webuploader-container .webuploader-pick{padding:5px 10px;}
</style>
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" />
<input type='hidden' id='vid' value='{$id}'/>
<div class="wst-shop-head"><span>商品卡券</span><a href="{:url('home/goods/'.$src)}">返回</a></div>
<div class="wst-shop-tbar">
  <label>
    状态：<select id='isUse' class="s-query">
             <option value='-1'>全部</option>
             <option value='0'>未使用</option>
             <option value='1'>已下单</option>
          </select>
    卡券号：<input type="text" name="cardNo" id="cardNo" class="s-query" />
    <a class="s-btn" onclick="stockByPage()">查询</a>
    <div id='importBtn' style='float:right;'>导入卡券</div>
    <a style='float:right;height:30px;line-height:50px;' href='__STATIC__/template/goodsvirtuals.xls' target='_blank'>下载模板</a>
  </label>
</div>
<div class="wst-shop-content"> 
   <div class="s-menu">
      <a href='javascript:void(0);' onclick="delCard({$id},1)" class="s-del"><span>删除</span></a>
      <a href='javascript:void(0);' onclick="editCard(0)" class="s-add"><span>新增</span></a>
   </div>
   <table class='wst-list'>
   <thead>
   <tr>
     <th width="10" >
     <div class="checkbox-box-s checkbox-box-s-all">
     <input style="margin-left:2px;" class="wst-checkbox-s" onclick="javascript:WST.checkChks(this,'.vchk')" type='checkbox' id="all"/>
     <label for="all"></label>
     </div>
     </th>
     <th>卡券号</th>
     <th>密码</th>
     <th>状态</th>
     <th>消费订单</th>
     <th width="120">操作</th>
   </tr>
   </thead>
   <tbody id='list'></tbody>
   <tfoot>
     <tr align="center"><td colspan='10' id='pager'></td></tr>
   </tfoot>
   <script id="tblist" type="text/html">
   {{# for(var i = 0; i < d.length; i++){ }}
   <tr>
      <td>
      <div class="checkbox-box-s">
      <input type='checkbox'  class='vchk wst-checkbox-s' id="chk-{{i}}" value='{{d[i]['id']}}' /><label for="chk-{{i}}"></label>
      </div>
      </td>
      <td>{{d[i]['cardNo']}}</td>
      <td>{{d[i]['cardPwd']}}</td>
      <td>{{getUseStatus(d[i]['isUse'])}}</td>
      <td>{{WST.blank(d[i]['orderNo'],' - ')}}</td>
      <td>
        {{# if(d[i]['isUse']==0){ }}
         <a class="g-handle" href='javascript:editCard({{d[i]['id']}})'>[编辑]</a>
        {{# } }} 
         <a class="g-handle" href='javascript:delCard({{d[i]['id']}},0)'>[删除]</a>
      </td>
   </tr>
   {{# } }}
   </script>
  </table>
  <div id='pager'></div>
  <div class="s-menu">
      <a href='javascript:void(0);' onclick="delCard({$id},1)" class="s-del"><span>删除</span></a>
      <a href='javascript:void(0);' onclick="editCard(0)" class="s-add"><span>新增</span></a>
   </div> 
</div>
{/block}  
{block name="js"}
<script type='text/javascript' src='__STATIC__/plugins/webuploader/webuploader.js?v={$v}'></script>
<script type='text/javascript' src='__STYLE__/shops/goodsvirtuals/virtuals.js?v={$v}'></script>
<script>
$(function(){stockByPage()})
</script>
{/block}